<?php if(! defined('BASEPATH')) exit('No direct script access allowed');

    class te extends My_controller{
        public $page_title = 'Quan tri noi dung';
        public $table_name = '';
        public $route_name = '';
        public $business_model;
        public $save_notification = 'Hoan tat viec sua doi du lieu';
        public $can_upload_image = false;
        public $base_admin_url = 'ci-admin/';


        public function __construct(){parent :: __construct();}

        public function can_this_user_access_this_page(){
            return $this->is_admin_logged();
        }

        public function set_admin_logged($user){
            $this->session->set_userdata('admin_logged', $user);
        }

        public function unset_admin_logged(){
            $this->session->unset_userdata('admin_logged');
        }

        public function is_admin_logged(){
            return $this->session->userdata('admin_logged') !== false;
        }

        public function get_logged_admin_account(){
            return $this->session->userdata('admin_logged');
        }

        public function index(){
            $header_data = array();
            $header_data['show_menu'] = true;
            $view_data =$this->get_view_data();
            $view_data['list'] = $this->get_list();
            $view_data['actions'] = $this->get_list_actions();
            $this->load_view('list_template', $header_data, $view_data);
        }

        public function update($id){
            $header_data = array();
            $header_data['show_menu'] = true;
            $view_data = $this->get_view_data();
            $view_data['fields'] = $this->get_fields($id);
            $view_data['actions'] = $this->get_form_actions($id);
            $this->load_view('form_template', $header_data, $view_data);

        }

        public function delete(){
            if($this->input->post('selected') === false)
                redirect(base_url().$this->base_admin_url.$this->route_name);
            $selected = $this->input->post('selected');
            foreach($selected as $id){
                $this->db->delete($this->table_name, array('id' => $id));
            }
        }

        public function save($districtid){}

        public function get_view_data(){}

        public function hook_breadcrumb(){}

        public function get_list_actions(){}

        public function get_form_actions(){}

        public function get_post_data(){}

        public function   (){}

        public function get_list(){}

        public function hook_redirect_url_after_save($id){}

        public function hook_cancel_url(){}

        public function upload_image($input_file_name, $old_file_name = '', $upload_path = 'uploads/'){}

        public function delete_file($file_path){}

        public function load_view($view, $header_data, $view_data){}

    }

?>